Optimal. Leaf size=65 \[ \frac {b x}{8}-\frac {a \cos ^3(c+d x)}{3 d}+\frac {b \cos (c+d x) \sin (c+d x)}{8 d}-\frac {b \cos ^3(c+d x) \sin (c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {2917, 2645, 30,
2648, 2715, 8} \begin {gather*} -\frac {a \cos ^3(c+d x)}{3 d}-\frac {b \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {b \sin (c+d x) \cos (c+d x)}{8 d}+\frac {b x}{8} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2645
Rule 2648
Rule 2715
Rule 2917
Rubi steps
\begin {align*} \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx &=a \int \cos ^2(c+d x) \sin (c+d x) \, dx+b \int \cos ^2(c+d x) \sin ^2(c+d x) \, dx\\ &=-\frac {b \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{4} b \int \cos ^2(c+d x) \, dx-\frac {a \text {Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {a \cos ^3(c+d x)}{3 d}+\frac {b \cos (c+d x) \sin (c+d x)}{8 d}-\frac {b \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{8} b \int 1 \, dx\\ &=\frac {b x}{8}-\frac {a \cos ^3(c+d x)}{3 d}+\frac {b \cos (c+d x) \sin (c+d x)}{8 d}-\frac {b \cos ^3(c+d x) \sin (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 61, normalized size = 0.94 \begin {gather*} \frac {b x}{8}-\frac {a \cos ^3(c+d x)}{3 d}+\frac {1}{8} b \left (-\frac {\cos (4 d x) \sin (4 c)}{4 d}-\frac {\cos (4 c) \sin (4 d x)}{4 d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 57, normalized size = 0.88
method | result | size |
risch | \(\frac {b x}{8}-\frac {a \cos \left (d x +c \right )}{4 d}-\frac {b \sin \left (4 d x +4 c \right )}{32 d}-\frac {a \cos \left (3 d x +3 c \right )}{12 d}\) | \(48\) |
derivativedivides | \(\frac {-\frac {a \left (\cos ^{3}\left (d x +c \right )\right )}{3}+b \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d}\) | \(57\) |
default | \(\frac {-\frac {a \left (\cos ^{3}\left (d x +c \right )\right )}{3}+b \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d}\) | \(57\) |
norman | \(\frac {\frac {b x}{8}-\frac {2 a}{3 d}-\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {7 b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {7 b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {b x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {3 b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {b x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {b x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}-\frac {2 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) | \(205\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 39, normalized size = 0.60 \begin {gather*} -\frac {32 \, a \cos \left (d x + c\right )^{3} - 3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} b}{96 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 51, normalized size = 0.78 \begin {gather*} -\frac {8 \, a \cos \left (d x + c\right )^{3} - 3 \, b d x + 3 \, {\left (2 \, b \cos \left (d x + c\right )^{3} - b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 119 vs.
\(2 (56) = 112\).
time = 0.18, size = 119, normalized size = 1.83 \begin {gather*} \begin {cases} - \frac {a \cos ^{3}{\left (c + d x \right )}}{3 d} + \frac {b x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {b x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {b x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {b \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {b \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin {\left (c \right )}\right ) \sin {\left (c \right )} \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 47, normalized size = 0.72 \begin {gather*} \frac {1}{8} \, b x - \frac {a \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac {a \cos \left (d x + c\right )}{4 \, d} - \frac {b \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.66, size = 125, normalized size = 1.92 \begin {gather*} \frac {b\,x}{8}-\frac {-\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\frac {7\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{4}+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-\frac {7\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{4}+\frac {2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}+\frac {2\,a}{3}}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________